const http = require("node:http");
const url = require("node:url");

http.createServer((req,res)=>{
    const {pathname} = url.parse(req.url);
    if (pathname === "/login") {
        let data = "";
        req.on("data",(chunk)=>{
            data += chunk;
        })
        req.on("end",()=>{
            res.setHeader("Content-Type", "applicaltion/json")
            res.statusCode = 200;
            console.log("success");
            res.end(data);
        })
    }else{
        req.statusCode = 404;
        res.end(404);
    }
}).listen(98,()=>{
    console.log("the serve is runing at 98 port");
})